package com.thousandsunny.consumer;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.thousandsunny.userInterface.UserInterface;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Savitar
 */
@Service
public class UserService {

    @Autowired
    private UserInterface userInterface;

    @HystrixCommand(fallbackMethod = "fallBack")
    public String detail(int id) {
        return "" + userInterface.userDetail(id);
    }

    public String fallBack(int id) {
        return "fallBack" + id;
    }

}
